﻿//using System;
//using System.Data;
//using System.Data.SQLite;
//using System.IO;

//namespace TestAgentDatabases
//{
//    class SQLiteTest : DatabaseTest
//    {
//        protected override void InsertOrder(int databaseId, int orderIndex, IDbConnection connection, ref IDbCommand dbCommand)
//        {
//            if (dbCommand == null)
//            {
//                dbCommand = connection.CreateCommand();
//                dbCommand.CommandText = "insert into " + TableName + " (amount, executionDate, Status) values (?, ?, ?)";
//                AddParameter(dbCommand, "amount", DbType.Single);
//                AddParameter(dbCommand, "executionDate", DbType.DateTime);
//                AddParameter(dbCommand, "status", DbType.Int32);
//            }

//            ((IDbDataParameter)dbCommand.Parameters["amount"]).Value = orderIndex;
//            ((IDbDataParameter)dbCommand.Parameters["executionDate"]).Value = DateTime.UtcNow;
//            ((IDbDataParameter)dbCommand.Parameters["status"]).Value = 1;
//            dbCommand.ExecuteNonQuery();
//        }

//        protected override string GetCreateTableSQL(int databaseId)
//        {
//            return "create table " + TableName + " (orderId integer primary key, amount real not null, executionDate text not null, Status integer)";           
//        }

//        protected override IDbConnection CreateDatabaseConnection(int databaseId)
//        {
//            return GetDatabaseConnection(databaseId);
//        }

//        protected override IDbConnection GetDatabaseConnection(int databaseId)
//        {
//            var builder = new SQLiteConnectionStringBuilder
//                              {DataSource = Path.Combine(DatabaseDirectory, "db" + databaseId + ".sqllite")};
//            return new SQLiteConnection(builder.ConnectionString);
//        }
//    }
//}